/*
* acooly.cn Inc.
* Copyright (c) 2017 All Rights Reserved.
* create by ouwen
* date:2017-09-20
*/
package com.yiji.fintech.musfinance.entity;


import com.acooly.core.common.domain.AbstractEntity;
import com.acooly.core.utils.Money;
import com.yiji.fintech.musfinance.base.enums.*;
import com.yiji.fintech.musfinance.common.annotation.ChannelAnnotation;
import com.yiji.fintech.musfinance.common.annotation.FieldQuery;
import com.yiji.fintech.musfinance.common.enums.CalculateTypeEnum;
import com.yiji.fintech.musfinance.common.enums.StatusEnum;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.NotEmpty;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Table;
import javax.validation.constraints.Size;

/**
 * center_route_rule Entity
 *
 * @author ouwen
 * Date: 2017-09-20 22:12:49
 */
@Getter
@Setter
@Entity
@Table(name = "center_route_rule")
public class RouteRule extends AbstractEntity {
	/** serialVersionUID */
	private static final long serialVersionUID = 1L;


	/** 商户号 */
	@NotEmpty
	@Size(max=36)
	@ChannelAnnotation
	@FieldQuery
    private String partnerId;

	/** 清算渠道API */
	@NotEmpty
	@Size(max=32)
    private String gatewayChannelApi;

	/** 交易类型 */
    @Enumerated(EnumType.STRING)
	@ChannelAnnotation
	@FieldQuery
    private TransactionTypeEnum transactionType;

	/** 子交易类型 */
    @Enumerated(EnumType.STRING)
	@ChannelAnnotation
	@FieldQuery
    private SubTransactionTypeEnum subTransactionType;

	/** 对公对私 */
    @Enumerated(EnumType.STRING)
	@ChannelAnnotation
	@FieldQuery
    private PersonalCorporateTypeEnum personalCorporateType;

	/** 借贷类型 : */
    @Enumerated(EnumType.STRING)
	@ChannelAnnotation
	@FieldQuery
    private CardTypeEnum cardType;

	/** 银行编码 */
	@Size(max=255)
	@ChannelAnnotation
	@FieldQuery
    private String instBankId;

	/** 规则金额 */
	private Money ruleAmount;

	/** 优先级 */
    private Integer priority;

	/** 流量权重 */
    private Integer weight;

	/** 金额规则 */
	@Enumerated(EnumType.STRING)
	private CalculateTypeEnum calculateType;

	/** 验证要素类型 */
	@Enumerated(EnumType.STRING)
	@ChannelAnnotation
	@FieldQuery
	private ElementTypeEnum elementType;

	/** 扩展参数 */
	@Size(max=200)
    private String extendField;

	/** MEMO */
	@Size(max=128)
    private String memo;

	/** 状态 */
    @Enumerated(EnumType.STRING)
	@ChannelAnnotation
	@FieldQuery
    private StatusEnum status;

}
